<template>
  <el-container direction="vertical">
    <Header></Header>
    <el-container>
      <el-container direction="vertical">
        <el-main :style="defaultHeight" style="padding: 20px; overflow-x: hidden">
          <router-view />
        </el-main>
        <Footer style="padding: 0;"></Footer>
      </el-container>
    </el-container>
  </el-container>
</template>

<script>
// 引入头部组件
import Header from '../components/common/header'
import Footer from '../components/common/footer'
export default {
  name: 'index',
  components: {
    Header,
    Footer
  },
  data () {
    return {
      defaultHeight: {
        minHeight: ''
      }
    }
  },
  methods: {
    getHeight () {
      this.defaultHeight.minHeight = window.innerHeight - 90 + 'px'
    }
  },
  created () {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  }
}
</script>

<style scoped>

</style>
